<?php

/**
 * Created by PhpStorm.
 * User: yuliang
 * Date: 2017/5/29
 * Time: 下午11:17
 */
namespace app\common\validate;

use think\Validate;
class User extends Validate
{
    protected $rule = [
        'mobile' => 'number|length:11',
        'code' => 'require|number|length:4',
        'real_name' => 'require',
        'id_card' => 'require|length:18',
        'card' => 'require|number',
        'bank' => 'require',
        'province' => 'require|number',
        'city' => 'require|number',
        'district' =>'require'

    ];

    protected $message = [
        'email' => '邮箱格式错误',
        'mobile.number' => '手机号码必须为数字',
        'real_name' => '请输入您的真实姓名',
        'id_card' => '请输入正确的身份证号',
        'bank' => '请输入开户行',
        'card' => '请填写正确的卡号',
        'district' => '请填写开户行所在地'
    ];

    protected $scene = [
        'add' => ['mobile','code'],
        'edit' => ['district','bank','id_card','card'],
    ];
}